package com.tubang.logistics.mapper;

import com.tubang.logistics.vo.statistics.*;
import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.tubang.logistics.entity.LogisticsOrderEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 物流公司运单 Mapper 接口
 * </p>
 *
 * @author wsl
 * @since 2017-12-31
 */
@Mapper
public interface LogisticsOrderMapper extends BaseMapper<LogisticsOrderEntity> {

	List<OrderDataSimpleVO> getOrderData(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
										 @Param("userId") String userId);

	List<OrderTableVO> getOrderTableByParam(Map<String, Object> paramMap);

	OrderDataSimpleVO getBusinessByTimeUnit(@Param("startTime") Date from, @Param("endTime") Date from1,
											@Param("userId") String userId);

	OrderDataSimpleVO getSumByParam(Map<String, Object> paramMap);

	BigDecimal getAllMoneyByCarrier(String userId);

	List<OrderDataSimpleVO> getOrderDataByUserId(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
												 @Param("userId") String userId);

	List<GoodsPercentVO> getGoodsDataByCarrierLimitNine(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
														@Param("userId") String userId);

	OrderDataSimpleVO countGoodsNumByCarrier(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
											 @Param("userId") String userId, @Param("carrier") boolean carrier);

	Long countGoodsTypeNumByCarrier(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
									@Param("userId") String userId);

	Long countGoodsNumByGoodsNameAndCarrier(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
											@Param("goodsType") String goodsType, @Param("userId") String userId);

	List<GoodsTableVO> getGoodsTableByParam(Map<String, Object> paramMap);

	GoodsDataSimpleVO getGoodsSumByParam(Map<String, Object> paramMap);

	List<UserPercentVO> getUserDataByCarrierLimitNine(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
													  @Param("userId") String userId, @Param("carrier") boolean carrier);

	List<UserTableVO> getUserTableByCarrierParam(Map<String, Object> paramMap);
}